<template>
    <div id="orderDetail" :style="showOrderBtType==false?'padding-bottom:0;':''">
        <div id="orderDetailContainer"></div>
        <textarea id="orderNum" style="position: absolute;top: -999px"></textarea>
        <div class="status" v-if="showStateInfo">
            <div>
                <p>{{stateInfo.stateStr}}</p>
                <p>
                    <span v-if="stateInfo.stateTime">{{timeCount | dateFrm}}</span>
                    <span>{{stateInfo.stateInfo}}</span>
                </p>
            </div>
        </div>
        <!-- 物流信息-->
        <div class="userInfos" @click="goLogistics" v-if="showLogisticsInfo">
            <div>
                <img src="https://khh-server.oss-cn-beijing.aliyuncs.com/resourse/IMG/static/express_car.png" alt="">
            </div>
            <div>
                <p style="color:#9948c3;">{{logisticsInfo.value}}</p>
                <p>{{logisticsInfo.time}}</p>
            </div>
            <div>
                <img style="margin-left:1rem;width: .16rem;height: .25rem; position:absolute;right:.24rem;" src="https://khh-server.oss-cn-beijing.aliyuncs.com/resourse/IMG/static/more@2x.png">
            </div>
        </div>
        <div class="userInfo" v-if="showAddress" style="margin-bottom: .2rem;">
            <div>
                <img src="https://khh-server.oss-cn-beijing.aliyuncs.com/resourse/IMG/static/address.png" alt="">
            </div>
            <div>
                <p>{{addressInfo.re_name}} {{addressInfo.re_mobile}}</p>
                <p>{{addressInfo.re_address}}</p>
            </div>
        </div>
        <div class="waitShare" v-if="showCutInfo">
            <p>
                <img src="https://khh-server.oss-cn-beijing.aliyuncs.com/resourse/IMG/static/icon_a.png">
                <span>{{msg}}</span>
            </p>
            <div>
                <div>
                    <img v-for="x in cutRecordList" :src="x.headImg">
                </div>
                <img class="changeImg" src="https://khh-server.oss-cn-beijing.aliyuncs.com/resourse/IMG/static/change/WechatIMG88.png">
                <div @click="inviteFriends" v-if="cutInfo.cutType==1">
                    <button v-if="showHelpCutBtn">邀请好友帮砍</button>
                </div>
            </div>
        </div>
        <div class="orderInfo" v-if="showPriceInfo">
            <div class="two">
                <div class="contest" @click="goBussiness(shopInfo.id)">
                    <ul class="left" :id="shopInfo.id">
                        <li class="text"><img :src="shopInfo.logo" style=" height: 0.4rem;border-radius: 50%;margin-right: 0.1rem;margin-top: .25rem;margin-bottom: .25rem;">{{shopInfo.name}}<img src="https://khh-server.oss-cn-beijing.aliyuncs.com/resourse/IMG/static/more@2x.png" style="width: 0.14rem;height: 0.26rem;margin-left: .12rem;"></li>
                    </ul>
                </div>
                <div class="cutDetail" @click="goNewDetail(proInfo.pro_id,proInfo.pro_type)">
                    <ul class="photo">
                        <li><img :src="proInfo.thumb" id="prophoto"></li>
                    </ul>
                    <ul class="cut-right">
                        <li class="one" style="-webkit-box-orient: vertical;">{{proInfo.title}}</li>
                        <li class="two">{{proInfo.spec}}<span style="color:#969696;font-size:.24rem;">{{proInfo.buyNum==''?'':'X'+proInfo.buyNum}}</span></li>
                    </ul>
                    <button class="newAdds" @click="goRefund(stateInfo.btType.type,$event)" v-if="stateInfo.btType.type">{{stateInfo.btType.value}}</button>
                </div>
                <div class="cut-btn">
                    <div class="number">
                        <ul v-for="(x,y) in priceInfo" :class="y=='buy_num'?'numB borB':'numB'" v-if="y=='now_price'?false:true">
                            <li class="left">{{y | toChinese}}</li>
                            <li class="right">{{y=='buy_num'?'X':'￥'}}<span>{{x}}</span></li>
                        </ul>
                    </div>
                    <p class="allMoney">共<span>{{priceInfo.buy_num}}</span>件商品 总价 : ¥ <span style="font-weight:bold;margin:0 .05rem;">{{priceInfo.now_price}}</span>(包邮)</p >
                    <img @click="redbag" v-if='showRedbag' src="https://khh-server.oss-cn-beijing.aliyuncs.com/resourse/IMG/static/imgChange/red_envelopeb.png">
                </div>
            </div>
        </div>
        <div class="message" @click="gozhichi">
            <ul class="m-left">
                <li class="img"><img src="https://khh-server.oss-cn-beijing.aliyuncs.com/resourse/IMG/static/service_a.png"></li>
                <li class="text">联系客服</li>
            </ul>
            <img src="https://khh-server.oss-cn-beijing.aliyuncs.com/resourse/IMG/static/more@2x.png">
        </div>
        <div class="num" v-if="showTimeInfo">
            <ul>
                <li v-for="(x,y) in timeInfo">
                    <span><input style="width:80%;" type="text" :value='x.msg' :id="'text'+y" readonly></span>
                    <button class='btnCopy'  v-if="x.type==1"  :data-clipboard-text="x.msg.substring(5)">复制</button></li>
            </ul>
        </div>
        <div class="btn" v-if="showOrderBtType">
            <div>
                <button v-for="x in btType" :type="x.type"  @click="btnclick(x.key,cutInfo.cutType)">{{x.key | status}}</button>
            </div>
        </div>
        <v-alert :context="context" v-if="showAlert"></v-alert>
        <!-- 点击延长收货弹框 -->
        <div class="opaction" v-if="show" @click="handleshow" :style="{height:winH}"></div>
        <div class="contests" v-if="sure">
            <div class="top">
                <p>{{promptInfo.first}}</p>
                <p>{{promptInfo.second}}</p>
            </div>
            <ul class="opacul">
                <li class="opback" @click="cancel">取消</li>
                <li class="opsure" @click="sures" >确定</li>
            </ul>
        </div>
        <!-- 分享成功弹框 -->
        <div class="success" v-if="success">
            <p class="sone">分享成功</p>
            <p class="stwo">继续分享帮砍的人会更多哦～</p>
            <ul class="sul">
                <li class="agare" @click="goShare">继续分享</li>
                <li class="home" @click="gohome">逛逛首页</li>
            </ul>
        </div>
        <!--点击继续分享-->
        <div class="place" v-if="none">
            <div style="margin-top:.6rem" v-if="cutInfo.cutType==2">
                <p>还可邀请<span>{{cutInfo.cutDetails}}位</span>好友帮砍价,</p>
                <!--<p>点击<span>右上角</span>继续分享,</p>-->
                <p>喊好友帮你砍价吧～</p>
            </div>
            <div style="margin-top:.6rem" v-if="cutInfo.cutType==3">
                <p>还可邀请<span>{{cutInfo.cutDetails}}位</span>好友帮砍价,</p>
                <!--<p>点击<span>右上角</span>继续分享,</p>-->
                <p>喊好友帮你砍价吧～</p>
            </div>
            <div v-else style="margin-top: .5rem;">
                <p>还可砍<span style="color:#9948c3;">{{cutInfo.cutDetails}}元</span></p>
                <!--<p>点击<span>右上角</span>继续分享,</p>-->
                <p>喊好友帮你砍价吧～</p>
            </div>
        </div>
        <!--点击图片红包-->
        <div class="contexts"  v-if="handleRedBag">
            <img :src="PayResult.orderInfo.headImg" class="icon">
            <h1 class="item">砍好货</h1>
            <p>送您一个拼手气红包</p>
            <p>快发给您的小伙伴吧～</p>
            <button class="btns" @click="goBase">发红包</button>
        </div>
        <!--点击发红包-->
        <div class="handleNum" v-if="showNum">
            <div style="margin-top:.6rem">
                <p>第<span>{{PayResult.couponInfo.maxNum}}</span>人领到的红包最大,</p>
                <p>点击<span>右上角</span>继续分享,</p>
                <p>喊好友拆手气红包吧～</p>
            </div>
        </div>
        <!--&lt;!&ndash;引导分享箭头&ndash;&gt;-->
        <!--<div class="arrow" v-if="arrow">-->
        <!--<img src="https://khh-server.oss-cn-beijing.aliyuncs.com/resourse/IMG/static/change/arrow.png">-->
        <!--</div>-->
        <!--关闭符号-->
        <div class="styleX" v-if="showTems" @click="handleshow">
            <img src="https://khh-server.oss-cn-beijing.aliyuncs.com/resourse/IMG/static/change/close_b.png">
        </div>
        <!--已抢光-->
        <div class="context" v-if="shsh">
            <p>{{newTest}}</p>
        </div>

    </div>
</template>

<script>

    import share from "../share/share.js";
    import config from "../config/config.js";
    import Alert from "../alert.vue";
    import Clipboard  from 'clipboard/dist/clipboard.js';
    import MtaH5 from 'mta-h5-analysis';

    export default{
        components:{
            "v-alert":Alert
        },
        data(){
            return{
                newTest:'',
                shsh:false,
                arrow:false,
                showTems:false,
                none:false,
                show:false,
                sure:false,
                success:false,
                addressInfo:{},
                priceInfo:{},
                timeInfo:[],
                btType:[],
                buttonType:'',
                PayResult:{},
                orderId:'',
                type:'',
                thumb:'',
                title:'',
                spec:'',
                msg:'',
                orderInfo:{},
                cutInfo:{},
                timerLoad:{},
                stateInfo:{},
                logisticsInfo:{},
                shareCutobj:{},
                shareRedbagobj:{},
                promptInfo:{},
                showStateInfo:Boolean,
                showAddress:Boolean,
                showCutInfo:Boolean,
                showGuessLike:Boolean,
                showLogisticsInfo:Boolean,
                showPriceInfo:Boolean,
                showTimeInfo:Boolean,
                showOrderBtType:Boolean,
                showAlert:false,
                showRedbag:Boolean,
                shopInfo:{},
                proInfo:{},
                context:'',
                timeCount:null,
                handleRedBag:false,
                showNum:false,
                shareType:0,
                showHelpCutBtn:true,
            }
        },
        computed:{
            cutRecordList(){
                if(this.cutInfo.cutType==2){
                    this.cutRecord={
                        "0":{
                            headImg:'https://khh-server.oss-cn-beijing.aliyuncs.com/resourse/IMG/static/empty_people.png',
                        },
                        // "1":{
                        //     headImg:'https://khh-server.oss-cn-beijing.aliyuncs.com/resourse/IMG/static/empty_people.png',
                        // },
                        // "2":{
                        //     headImg:'https://khh-server.oss-cn-beijing.aliyuncs.com/resourse/IMG/static/empty_people.png',
                        //
                        // }
                    };

                }else{
                    this.cutRecord={
                        "0":{
                            headImg:'https://khh-server.oss-cn-beijing.aliyuncs.com/resourse/IMG/static/empty_people.png',
                        },
                        "1":{
                            headImg:'https://khh-server.oss-cn-beijing.aliyuncs.com/resourse/IMG/static/empty_people.png',
                        },
                        "2":{
                            headImg:'https://khh-server.oss-cn-beijing.aliyuncs.com/resourse/IMG/static/empty_people.png',

                        },
                        "3":{
                            headImg:'https://khh-server.oss-cn-beijing.aliyuncs.com/resourse/IMG/static/empty_people.png',

                        },
                        "4":{
                            headImg:'https://khh-server.oss-cn-beijing.aliyuncs.com/resourse/IMG/static/empty_people.png',

                        }
                    };
                }
                return this.cutRecord
            }
        },
        methods:{
            goBase(){
                var that=this;
                this.showNum = true;
                this.handleRedBag = false;
                this.showTems = false;
                this.arrow = true;
                this.shareType=2;
            },
            redbag(){
                this.show = true,
                  this.handleRedBag = true;
                this.showNum = false;
                this.showTems = true;

            },
            goShare(){
                this.success=false;
                this.show=true;
                this.none=true;
                this.arrow = true;
                this.showTems= false;
            },
            goRefund(btType,$event){
                $event.stopPropagation();
                if(btType==1){
                    this.$router.push("/allorder/refund/"+this.orderId+'/FIRST_PUSH')
                }

            },
            goBussiness(id){
                this.$router.push('/business/'+id)
            },
            handleClick(){
                this.show = true,
                    this.sure = true;
            },
            handleshow(){
                this.sure = false;
                this.success = false;
                this.show = false;
                this.none = false;
                this.handleRedBag = false;
                this.showNum = false;
                this.arrow = false;
                this.showTems =false;
                this.shsh = false;
            },
            sures(){
                this.show = false,
                    this.sure = false,
                    this.OrderButtonListener(this.orderId,this.buttonType)
            },
            goLogistics(){
                this.$router.push("/logistics/"+this.orderId+'/SHOW_LOGISTICS')
            },
            gohome(){
                this.$router.push("/home/index/00")
            },
            cancel(){
                this.show = false,
                    this.sure = false
            },
            btnclick(key,cutType){
                this.buttonType=key;
                if(key=='CANCEL_ORDER'){
                    this.show=true;
                    this.sure=true;
                    this.promptInfo={
                        'first':'确定取消该订单吗？',
                        'second':''
                    }
                }else if(key=='DELETE_ORDER'){
                    this.show=true;
                    this.sure=true;
                    this.promptInfo={
                        'first':'确定删除该订单吗？',
                        'second':''
                    }
                }else if(key=='PAY_ORDER'){
                    this.payOrder(1,this.orderId);
                }else if(key=='SHOW_LOGISTICS'){
                    this.$router.push('/logistics/'+this.orderId+'/'+key);
                }else if(key=='SURE_ORDER'){
                    this.show=true;
                    this.sure=true;
                    this.promptInfo={
                        'first':'确认收货吗？',
                        'second':''
                    }
                }else if(key=='REMARK_ORDER'){
                    var prophoto=document.getElementById('prophoto').getAttribute('src');
                    this.goAssess(prophoto,this.orderId)
                }else if(key=='UPDATE_REMARK'){
                    var prophoto=document.getElementById('prophoto').getAttribute('src');
                    this.updateRemark(prophoto,this.orderId)
                }else if(key=='SHOW_DETAILS'){
                  var that = this;
                  if(that.cutInfo.cutType==1){
                    this.$router.push('/oneKan/'+this.$route.params.orderid)
                  }else if(that.cutInfo.cutType==2){
                    this.$router.push('/threekan/'+this.$route.params.orderid)
                  }else{
                    this.$router.push('/freeKan/'+this.$route.params.orderid)
                  }
                }


            },
            gozhichi(){
                window.location.href='https://www.sobot.com/chat/h5/index.html?sysNum=8aa3c6e204e843ce93d80c7b9208d4e6'
            },
            Countdown(){
                var _self=this;
                if(_self.timeCount==0){
                    _self.timeCount=0;
                    clearInterval(_self.timerLoad);
                }else{
                    _self.timerLoad=setInterval(function(){
                        _self.timeCount--;
                        if(_self.timeCount==0){
                            _self.timeCount=0;
                            clearInterval(_self.timerLoad);
                        }
                    },1000)
                }
            },
            GetOrderDetails(){
                this.orderId=this.$route.params.orderid;
                this.type=this.$route.params.type;
                var that=this;
                var link='/threekan/'+ this.orderId,
                    that=this;
                var newLink=link.replace(/\//g,'*');
                var value=JSON.stringify({"orderid":this.orderId,"type":this.type,"token":localStorage.getItem('token')}),
                    key=demo(value);
                axios.post('/Home/order/GetOrderDetails',{
                    value:value,
                    key:key
                },config)
                    .then(function(response) {
                        this.shareCutobj={
                            title:'来帮我砍价',
                            desc:'我在砍好货发现一件好货，快来帮我砍一刀，还能获取惊喜哦',
                            link:newLink,
                            /* imgUrl:response.data.data.userInfo.avatar,*/
                            callback:function(){
                                that.$nextTick(function(){
                                    that.none=false;
                                    that.show=true;
                                    that.success=true;
                                    that.showTems=true;
                                    that.arrow = false;
                                })
                            }
                        }
                        //是否显示状态
                        if(response.data.data.stateInfo==''){
                            this.showStateInfo=false;
                        }else{
                            this.showStateInfo=true;
                            this.stateInfo=response.data.data.stateInfo;
                            this.timeCount=response.data.data.stateInfo.stateTime;
                            this.$nextTick(function () {
                                this.Countdown()
                            })
                        }
                        //是否显示物流
                        if(response.data.data.logisticsInfo==''){
                            this.showLogisticsInfo=false
                        }else{
                            this.logisticsInfo=response.data.data.logisticsInfo
                        }
                        //是否显示地址
                        if(response.data.data.addressInfo==''){
                            this.showAddress=false
                        }else{
                            this.showAddress=true;
                            this.addressInfo=response.data.data.addressInfo;
                        }
                        //是否显示分享
                        if(response.data.data.cutInfo==''){
                            this.showCutInfo=false;
                            this.cutInfo={},
                                this.shareType=0;
                        }else{
                            this.cutInfo=response.data.data.cutInfo;
                        }
                        //是否显示价格
                        if(response.data.data.priceInfo==''){
                            this.showPriceInfo=false
                        }else{
                            this.showPriceInfo=true;
                            this.priceInfo=response.data.data.priceInfo;
                        }
                        //是否显示订单编号
                        if(response.data.data.timeInfo==''){
                            this.showTimeInfo=false;
                        }else{
                            this.showTimeInfo=true;
                            this.timeInfo=response.data.data.timeInfo;
                        }
                        //是否显示底部按钮
                        if(response.data.data.orderBtType.btType==''){
                            this.showOrderBtType=false;
                        }else{
                            this.showOrderBtType=true;
                            this.btType=response.data.data.orderBtType.btType;
                        }
                        //商家店铺信息
                        this.shopInfo=response.data.data.shopInfo;
                        this.proInfo=response.data.data.proInfo;
                        this.$nextTick(function(){
                            this.winH=document.getElementById('orderDetail').offsetHeight + 'px';
                        });
                        this.msg=response.data.data.cutInfo.msg;
                        //头像
                        if(response.data.data.cutInfo.headGroup){
                            for(var i=0;i<response.data.data.cutInfo.headGroup.length;i++){
                                this.cutRecordList[i]["headImg"]=response.data.data.cutInfo.headGroup[i]["headImg"]
                            }
                            if(response.data.data.cutInfo.headGroup.length==2||response.data.data.cutInfo.headGroup.length==5){
                                this.showHelpCutBtn=false;
                            }
                        }else{
                        }
                    }.bind(this))
                    .catch(function (error) {
                        console.log(error);
                    });
            },
            inviteFriends(){
                this.none = true;
                this.show = true;
                this.arrow = true;
                this.showTems = true;
                this.shareType=1;
            },
            GetPayResult(){
                var that=this;
                var value=JSON.stringify({"orderid":this.$route.params.orderid,"token":localStorage.getItem('token')}),
                    key=demo(value);
                axios.post('/Home/pay/PayResult',{
                    value:value,
                    key:key,
                    ticket:this.ticket
                },config)
                    .then(function(response) {
                        if(response.data.code==200){
                            if(response.data.data.couponInfo.type==2){
                                this.$nextTick(function(){
                                    this.showRedbag=false;
                                })
                            }else{
                                this.$nextTick(function(){
                                    var link='/redbag/'+response.data.data.couponInfo.couponShareid;
                                    var newLink=link.replace(/\//g,'*');
                                    this.showRedbag=true;
                                    this.PayResult=response.data.data;
                                    this.shareRedbagobj={
                                        title:'【砍好货】第'+response.data.data.couponInfo.maxNum+'个人领到的最大!',
                                        desc:'百元惊喜等你来撩，手快有，手慢无',
                                        link:newLink,
                                        imgUrl:'https://khh-server.oss-cn-beijing.aliyuncs.com/resourse/IMG/static/redbag.png',
                                        callback:function(){
                                            that.$nextTick(function(){
                                                that.handleshow();
                                                that.showRedbag=false;
                                            })
                                        }
                                    }
                                })
                            }
                        }
                    }.bind(this))
                    .catch(function (error) {
                        console.log(error);
                    });
            },
            OrderButtonListener(orderid,bt_type){
                var value=JSON.stringify({"orderid":orderid,"bt_type":bt_type,"token":localStorage.getItem('token')}),
                    key=demo(value);
                axios.post('/Home/order/OrderButtonListener',{
                    value:value,
                    key:key
                },config)
                    .then(function(response) {
                        if(response.data.code==200){
                            if(bt_type=='CANCEL_ORDER'){
                                this.GetOrderDetails()
                            }else if(bt_type=='DELETE_ORDER'){
                                this.show=false;
                                this.sure=false;
                                this.$router.go(-1)
                            }else if(bt_type=='SURE_ORDER'){
                                this.show=false;
                                this.sure=false;
                                this.$router.go(-1)
                            }
                        }
                    }.bind(this))
                    .catch(function (error) {
                        console.log(error);
                    });
            },
            OrderPayZero(orderid){
            var values=JSON.stringify({"orderid":orderid,"token":localStorage.getItem('token')}),
              keys=demo(values);
            axios.post('Home/Pay/OrderPayZero',{
              value:values,
              key:keys,
              ticket:this.ticket
            },config)
              .then(function(res) {
                if(res.data.code==200){
                  this.$store.commit('increment',res.data.ticket);
                  this.$router.push('/success/'+orderid)
                }
              }.bind(this))
              .catch(function (error) {
                console.log(error);
              });
          },
            payOrder(type,orderid){
              if(this.priceInfo.now_price==0){
                this.OrderPayZero(this.priceInfo.now_price);
              }else{
                var that=this;
                var values=JSON.stringify({"type":type,"money":this.priceInfo.now_price,"orderid":orderid,"token":localStorage.getItem('token')}),
                    keys=demo(values);
                axios.post('/Home/Pay/OrderPay',{
                    value:values,
                    key:keys
                },config)
                    .then(function(res) {
                        if(res.data.code==200){
                            function jsApiCall() {
                                WeixinJSBridge.invoke('getBrandWCPayRequest', {
                                        "appId": res.data.data.appId,     //公众号名称，由商户传入
                                        "timeStamp": res.data.data.timeStamp,//时间戳，自1970年以来的秒数
                                        "nonceStr": res.data.data.nonceStr, //随机串
                                        "package": res.data.data.package,
                                        "signType":"MD5",         //微信签名方
                                        "paySign": res.data.data.sign //微信签名
                                    },
                                    function(res){
                                        WeixinJSBridge.log(res.err_msg);
                                        if(res.err_msg == "get_brand_wcpay_request:ok"){
                                            that.$router.push('/success/'+orderid)
                                        }else{
                                            window.location.href=location.href;
                                        }
                                    }
                                );
                            }
                            function callpay()
                            {
                                if (typeof WeixinJSBridge == "undefined"){
                                    if( document.addEventListener ){
                                        document.addEventListener('WeixinJSBridgeReady', jsApiCall, false);
                                    }else if (document.attachEvent){
                                        document.attachEvent('WeixinJSBridgeReady', jsApiCall);
                                        document.attachEvent('onWeixinJSBridgeReady', jsApiCall);
                                    }
                                }else{
                                    jsApiCall();
                                }
                            }
                            callpay()
                        }else{
                            this.shsh = true;
                            this.show = true;
                            this.newTest = res.data.msg;
                        }
                    }.bind(this))
                    .catch(function (error) {
                        console.log(error);
                    })};
            },
            goAssess(imgUrl,orderid,){
                this.$router.push({
                    path:'/assess',
                    query:{
                        imgUrl:imgUrl,
                        orderid:orderid
                    }
                })
            },
            updateRemark(imgUrl,orderid){
                this.$router.push({
                    path:'/addTo',
                    query:{
                        imgUrl:imgUrl,
                        orderid:orderid
                    }
                })
            },
            goNewDetail(id,type){
                this.$router.push('/newDetail/' +id+ '' + '/' +type);
            },
        },
        created(){
            share({});
            this.GetOrderDetails();
            this.GetPayResult();
            MtaH5.init({
                "sid":'500594815',
                "cid":'500595819',
                "autoReport":0,
                "senseHash":0,
                "senseQuery":0,
                "performanceMonitor":0,
                "ignoreParams":[]
            });
            MtaH5.pgv();
        },
        filters:{
            toChinese:function(val){
                switch(val){
                    case 'buy_num':
                        return '商品数量';
                    case 'coupon_money':
                        return '优惠券金额';
                    case 'cut_money':
                        return '砍价金额';
                    case 'freight':
                        return '运费 （包邮）';
                    case 'pro_price':
                        return '商品金额';
                    case 'ticket_money':
                        return '余额';
                }
            },
            status:function(val){
                switch(val){
                    case 'CANCEL_ORDER':
                        return "取消订单";
                    case 'PAY_ORDER':
                        return "付款";
                    case 'URGE_ORDER':
                        return "催发货";
                    case 'EXTEND_ORDER':
                        return "延长收货";
                    case 'SHOW_LOGISTICS':
                        return "查看物流";
                    case 'SURE_ORDER':
                        return "确认收货";
                    case 'DELETE_ORDER':
                        return "删除订单";
                    case 'AFTER_BUY':
                        return "申请售后";
                    case 'REMARK_ORDER':
                        return "评价";
                    case 'UPDATE_REFUND':
                        return "修改申请";
                    case 'CANCEL_REFUND':
                        return "撤销申请";
                    case 'APPLY_PLATFORM_IN':
                        return "申请砍好货介入";
                    case 'AGAIN_REFUND':
                        return "重新申请";
                    case 'UPDATE_REMARK':
                        return "追评";
                    case 'FAX_LOGISTICS':
                        return "填写退货物流";
                    case 'SHOW_DETAILS':
                        return '查看详情'
                }
            },
            dateFrm:function(time){
                return formatSeconds(time)
            }
        },
        deactivated () {
            this.$destroy(true)
        },
        mounted(){
            var that=this;
            const clipboard = new Clipboard('.btnCopy');
            clipboard.on('success', function(e) {
                that.showAlert=true;
                that.context='复制成功';
                setTimeout(()=>{that.showAlert=false},2000)
                e.clearSelection();
            });
            clipboard.on('error', function(e) {
                console.error('Action:', e.action);
                console.error('Trigger:', e.trigger);
            });
        },
        watch:{
            'shareType':function(val,oldval){
                var that=this;
                if(val==1){
                    share(that.shareCutobj)
                }else if(val==2){
                    share(that.shareRedbagobj)
                }
            }
        }
    }
</script>

<style>
</style>